<!DOCTYPE html>

<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8" />
<title th:utext="#{title.editapplication}"></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="" />
<meta name="author" content="Dhrubo" />

<!-- Le styles -->
<link rel="stylesheet" type="text/css" media="all" th:href="@{/resources/css/bootstrap.css}" />

<link rel="stylesheet" type="text/css" media="all" th:href="@{/resources/css/bootstrap-responsive.css}" />

<link rel="stylesheet" type="text/css" media="all" th:href="@{/resources/css/DT_bootstrap.css}" />
	
<link rel="stylesheet" type="text/css" media="all" th:href="@{/resources/css/common.css}" />


</head>

<body>

	<div th:substituteby="fragments/userheader :: navbar"></div>

	<div class="container-fluid">


		<div class="row-fluid">

			<div class="span12">

				<form th:action="@{/updateapp}" th:object="${app}"
					class="form-horizontal" id="editappform" method="post">


					<fieldset>

						<legend>
							<span th:utext="#{editapplication}"></span>
							
							<div class="btn-group  pull-right">
    							<a class="btn btn-primary" href="listapplications" th:utext="#{listapplications}"></a>
    							<a class="btn btn-info" href="newapplication"
								th:utext="#{newapplication}"></a>
    						</div>
							
							
							
						</legend>


						<div class="alert alert-success" th:if="${keyupdated}">
							<button type="button" class="close" data-dismiss="alert">&times;</button>
							<span th:utext="#{keyupdate}"></span>
						</div>


						<div id="message"></div>

						<div class="control-group">
							<label class="control-label" for="name"
								th:utext="#{applicationname}"></label>
							<div class="controls">
								<input type="text" th:field="*{name}" class="input-xxlarge"
									th:placeholder="#{applicationname}" required="required" />
									
								<input type="hidden" th:field="*{id}" />	
							</div>
						</div>
						
						<div class="control-group">
							<label class="control-label" for="salt"  th:utext="#{salt}"></label>
							<div class="controls">
								<input type="text" th:field="*{salt}" class="input-xxlarge" id="salt" 
									th:placeholder="#{salt}" required="required" />
							</div>
						</div>

						
						<div class="control-group">
							<label class="control-label" for="pubk" th:utext="#{publickey}"></label>
							<div class="controls">
								<div class="input-append">
									<input type="text" th:field="*{publicKey}"
										class="input-xxlarge" id="pubk"
										th:placeholder="#{systemgenerated}" readonly="readonly" /> <a
										class="btn btn-warning" type="button"
										th:utext="#{updatepubkey}"
										th:href="@{/updatekey(application=${app.id},  type='pub')}"></a>
								</div>
							</div>
						</div>

						<div class="control-group">
							<label class="control-label" for="name" th:utext="#{privatekey}"></label>
							<div class="controls">
								<div class="input-append">
									<input type="text" th:field="*{privateKey}"
										class="input-xxlarge" id="pvtk"
										th:placeholder="#{systemgenerated}" readonly="readonly" /> <a
										class="btn btn-warning" type="button"
										th:utext="#{updateprivkey}"
										th:href="@{/updatekey(application=${app.id},  type='pvt')}"></a>
								</div>
							</div>
						</div>
						
						<div class="control-group">
							<label class="control-label" for="name" th:utext="#{description}"></label>
							<div class="controls">

								<textarea rows="3" cols="40" th:field="*{description}"
									class="input-xxlarge" th:placeholder="#{description}"></textarea>

								<input type="hidden" th:value="${id}" name="application" />
							</div>
						</div>
						


						<div class="form-actions">
							<button type="submit" class="btn btn-success" th:utext="#{save}"></button>
							<button type="reset" class="btn btn-info" th:utext="#{cancel}"></button>


						</div>

					</fieldset>
				</form>


			</div>
			<!--/span-->
		</div>
		
		<!-- 	
		<div class="row-fluid">

			<div class="span12">

				<div
					th:substituteby="fragments/table-socialproviders :: providertable"></div>
			</div>
			
		</div>
		 -->
		<!--/row-->

		<hr />



	</div>
	<!--/.fluid-container-->

	<div th:substituteby="fragments/userheader :: footer"></div>

	<!-- Le javascript
    ================================================== -->
	<!-- Placed at the end of the document so the pages load faster -->

	<script src="js/jquery.js" th:src="@{/resources/js/jquery.js}"></script>

	<script th:src="@{/resources/js/bootstrap-dropdown.js}"></script>

	<script th:src="@{/resources/js/bootstrap-alert.js}"></script>

	<script th:src="@{/resources/js/jquery.dataTables.js}"></script>
	<script th:src="@{/resources/js/DT_bootstrap.js}"></script>
	
	<script th:src="@{/resources/js/editapplication.js}"></script>

</body>
</html>
